/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import { request } from '@umijs/max';

export async function queryClassList(params: Global.pageParams) {
  return request<Global.Result<Class.ClassEntity[]>>('/api/queryClassList', {
    method: 'post',
    params,
  });
}

export async function addClass(data: Class.ClassEntity) {
  return request<Global.Result<Class.ClassEntity>>('/api/createClass', {
    method: 'post',
    data,
  });
}

export async function editClass(data: Class.ClassEntity) {
  return request<Global.Result<Class.ClassEntity>>(`/api/updateClass`, {
    method: 'patch',
    data: data,
  });
}

export async function delClass(data: Pick<Class.ClassEntity, 'id'>) {
  const { id } = data;
  return request<Global.Result<Class.ClassEntity>>(`/api/destroyClass/${id}`, {
    method: 'delete',
  });
}
